//
//  UIView+UIView_xywh.m
//  Inspiration
//
//  Created by Mac on 15/10/15.
//  Copyright © 2015年 riverlj. All rights reserved.
//

#import "UIView+xywh.h"

@implementation UIView (xywh)

- (CGFloat)getViewHeight{
    return self.frame.size.height;
}

- (void)setViewHeight:(CGFloat)height{
    self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, height);
}

- (void)setViewWidth:(CGFloat)width{
    self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, width, self.frame.size.height);
}
- (CGFloat)getViewWidth{
    return self.frame.size.width;
}

- (void)setViewX:(CGFloat)x{
    self.frame = CGRectMake(x, self.frame.origin.y, self.frame.size.width, self.frame.size.height);
}
- (CGFloat)getViewX{
    return self.frame.origin.x;
}

- (void)setViewY:(CGFloat)y{
    self.frame = CGRectMake(self.frame.origin.x, y, self.frame.size.width, self.frame.size.height);
}
- (CGFloat)getViewY{
    return self.frame.origin.y;
}

@end
